import request from '@/utils/request'

const batteryApi = {
    lists: '/api/v2/batteries'
}
export const batteryStatus = [
    '丢失',
    '损坏',
    '正常',
    '维修',
    '报废'
]

export function getBatteryLists (paramter) {
    return request({
        url: batteryApi.lists,
        method: 'get',
        params: paramter
    })
}

export function deleteBattery (id) {
    return request({
        url: batteryApi.lists + '/' + id,
        method: 'delete'
    })
}

export function updateBattery (id, data) {
    console.log(data)
    return request({
        url: batteryApi.lists + '/' + id,
        method: 'put',
        data: data
    })
}

export function postBattery (id, data) {
    return request({
        url: batteryApi.lists + '/' + id,
        method: 'post',
        data: data
    })
}
